package com.mzhmxh.service.impl;

import com.mzhmxh.mapper.SmbmsRolemapper;
import com.mzhmxh.pojo.SmbmsRole;
import com.mzhmxh.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Author LiJinCheng
 * @Date 2020/7/11 6:35 下午
 * @Version 1.0
 * @package com.mzhmxh.service.impl
 **/
@Service
@Transactional
public class RoleServiceImpl implements RoleService {
    @Autowired
    private SmbmsRolemapper rolemapper;

    @Override
    public List<SmbmsRole> selectAll() {
        return rolemapper.selectAll();
    }

    @Override
    public boolean add(SmbmsRole role) {
        return rolemapper.add(role);
    }

    @Override
    public int roleCodeIsExist(String roleCode) {
        return rolemapper.roleCodeIsExist(roleCode);
    }

    @Override
    public boolean modify(SmbmsRole role) {
        return rolemapper.modify(role);
    }

    @Override
    public SmbmsRole selectByPrimaryKey(Long id) {
        return rolemapper.selectByPrimaryKey(id);
    }

    @Override
    public boolean deleteRoleById(Long id) {
        return rolemapper.deleteByPrimaryKey(id);
    }
}
